package com.yugao.fintech.antelope.statistic.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yugao.fintech.antelope.base.model.BasePO;
import com.yugao.fintech.antelope.base.tenant.core.DataIsolation;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/**
 * 统计登录与登出数据
 *

 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("stat_login")
@DataIsolation(filterTenant = true, tableName = "stat_login")
public class StatLogin extends BasePO {
    @TableId
	private Long id;
	
	/**
	 * 登录次数
	 */
	private Long loginCount;

	/**
	 * 退出次数
	 */
	private Long logoutCount;
	
	/**
	 * 统计日期
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private LocalDate statDate;

    public static LambdaQueryWrapper<StatLogin> lqw() {
		return Wrappers.lambdaQuery();
	}

	public static LambdaUpdateWrapper<StatLogin> luw() {
		return Wrappers.lambdaUpdate();
	}
}
